﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace SnakeGame_Roman
{
   public class TickGenerator
    {
        private int _speed {get;set;}
        public event EventHandler Tick;
       // public int speed;

        public void Start(int speed)
        {
            for (;;)
            {
               
                Thread.Sleep(this._speed = speed);
                OnTick();
              
            }
        }
   
        protected virtual void OnTick()
        {
            if (this.Tick != null)
                this.Tick(this, null);
        }
       
        public List<Int32> GameSpeed()
        {
            List<Int32> gameSpeed = new List<Int32>() {250,900,800,700,600,500,400,300,200,100 };
          
          return gameSpeed;
        }
   
    }

}
